package com.example.educationplatformbackend.service.Impl;

import com.example.educationplatformbackend.domian.UserBean.CompleteUser;
import com.example.educationplatformbackend.domian.UserBean.LoginUser;
import com.example.educationplatformbackend.domian.UserBean.RegisterUser;
import com.example.educationplatformbackend.domian.UserBean.User;
import com.example.educationplatformbackend.mapper.UserMapper;
import com.example.educationplatformbackend.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService implements UserServiceImpl {



    @Autowired
    UserMapper userMapper;
    @Override
    public User login(LoginUser loginUser) {
        return userMapper.login(loginUser.getUsername(), loginUser.getPassword(),loginUser.getLevel());
    }

    @Override
    public void register(RegisterUser registerUser) {
        userMapper.register(registerUser);
    }

    @Override
    public List<CompleteUser> getAlluser() {
        return userMapper.getAlluser();
    }

    @Override
    public void update(CompleteUser completeUser) {
         userMapper.update(completeUser);
    }

    @Override
    public void deleteById(int id) {
        userMapper.deleteById(id);
    }


}
